﻿#pragma once

#include "include/cef_app.h"

// Implement application-level callbacks for the browser process.
class QtCEFApp : public CefApp, public CefBrowserProcessHandler {
public:
    QtCEFApp();

    // CefApp methods:
    CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() override { return this; }
    void                                OnBeforeCommandLineProcessing(const CefString&          process_type,
                                                                      CefRefPtr<CefCommandLine> command_line) override;

    // CefBrowserProcessHandler methods:
    void                 OnContextInitialized() override;
    CefRefPtr<CefClient> GetDefaultClient() override;

private:
    // Include the default reference counting implementation.
    IMPLEMENT_REFCOUNTING(QtCEFApp);
};
